Eliminating Irrelevant Non-determinism in Functional Logic Programs
نویسندگان
چکیده
Functional logic programming languages support non-deterministic search and a flexible use of defined operations by applying them to unknown values. The use of these features has the risk that equal values might be computed several times or I/O computations could fail due to non-deterministic subcomputations. To detect such problems at compile time, we present a method to locate non-deterministic operations. If the non-determinism caused by some operation is semantically not relevant, the programmer can direct the compiler to produce only one result of a computation. If all the results of the computations are equal, this directive preserves the semantics and improves the operational behavior of programs. We define the declarative meaning of such annotations and propose both testing and verification techniques that respectively increase the confidence or formally prove that the non-determinism of an operation is irrelevant.
منابع مشابه
Semantic Determinism and Functional Logic Program Properties
In modern functional logic languages like Curry or Toy, programs are possibly non-confluent and nonterminating rewrite systems, defining possibly non-deterministic non-strict functions. Therefore, equational reasoning is not valid for deriving properties of such programs. In a previous work we showed how a mapping from CRWL –a well known logical framework for functional logic programming– into ...
متن کاملNarrowing for Non-Determinism with Call-Time Choice Semantics
In a recent work we have proposed let-rewriting, a simple one-step relation close to ordinary term rewriting but able, via local bindings, to express sharing of computed values. In this way, let-rewriting reflects the call-time choice semantics for non-determinism adopted by modern functional logic languages, where programs are rewrite systems possibly non-confluent and non-terminating. Equival...
متن کاملA Functional Action Language Front-End
In this paper we extend the notation of functional logic programs introduced in [1] by: (i) describing a formal translation of nested function references; (ii) dealing with set terms in the rule heads to allow non-determinism; and (iii) introducing high level constructions for representing action domains. The semantics we consider in this work, both for functional logic programs and for the act...
متن کاملHigher Order Functional Logic Programming A Systematic Development
We develop an e ective model for higher order functional logic programming by re ning higher order narrowing calculi The re nements reduce the high degree of non determinism in narrowing calculi utilizing properties of functional logic programs These include convergent and left linear rewrite rules All re nements can be combined to a narrowing strategy which generalizes call by need as in funct...
متن کاملDefault Rules in Functional Logic Programs ⋆
In functional logic programs, rules are applicable independently of textual order, i.e., any rule can potentially be used to evaluate an expression. This is similar to logic languages and opposite to functional languages, e.g., Haskell enforces a strict sequential interpretation of rules. However, in some situations it is convenient to express alternatives by means of compact default rules. Alt...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2017